/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.webapp.model;

import java.io.Serializable;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 *
 * @author Tonytran
 */
@Entity
@Table(name = "courses")
//@AssociationOverrides({@AssociationOverride(name = "courses",joinColumns = @JoinColumn(name = "id")) })
public class CoursesTimeTabling implements Serializable
{
    @Id
    @GeneratedValue
    @Column(name = "course_id")
    private int course_id;
    
    @Column(name = "name")
    private String name;
    
    @Column(name = "code")
    private String code;
    
    @Column(name = "credits")
    private int credits;

    //@OneToOne(fetch=FetchType.LAZY)
    //@JoinColumn(name = "course_id")
    //private Courses courses;
    
    @OneToOne
    @PrimaryKeyJoinColumn
    private CoursingTimeTabling coursesdetail;

    
    public int getCourse_id() {
        return course_id;
    }

    public void setCourse_id(int course_id) {
        this.course_id = course_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getCredits() {
        return credits;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    public CoursingTimeTabling getCoursesdetail() {
        return coursesdetail;
    }

    public void setCoursesdetail(CoursingTimeTabling coursesdetail) {
        this.coursesdetail = coursesdetail;
    }

}
